package momo.app.status;

import momo.app.structure.Message;
import momo.app.structure.SimpleCircularList;

public class RcvMsgHistory
{
	private final int capacity = 1000;
	private SimpleCircularList<Message> history;
	private static RcvMsgHistory rcvMsgHistory;
	
	private RcvMsgHistory()
	{
		history = new SimpleCircularList<Message>(capacity);
	}
	
	public static RcvMsgHistory getInstance()
	{
		if ( rcvMsgHistory == null )
			rcvMsgHistory = new RcvMsgHistory();
		return rcvMsgHistory;
	}
	
	synchronized public void store(Message msg)
	{
		history.add(msg);
	}
	
	synchronized public boolean contains(Message msg)
	{
		return history.contains(msg);
	}
	
}//end of class RcvMsgHistory
